package com.zmn.oms.persistence.interfaces.conf.distribute;

import com.zmn.oms.model.entity.conf.distribute.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 类描述：派单参数平台配置数据处理接口
 *
 * @author mujunlin
 * @version v1.0
 * @since 2019/10/17 11:20
 */
@Repository
public interface DistributeWeightPlatDao {

    DistributeWeightPlat findByKey(@Param("distributePlatId") Integer distributePlatId);

    List<DistributeWeightPlat> findByPlatAndBizType(@Param("plat") Integer plat,
                                                    @Param("bizType") Integer bizType,
                                                    @Param("distributeWay") Integer distributeWay);

    List<DistributeWeightPlat> findByPlatAndBizTypeAndCityId(@Param("plat") Integer plat,
                                                             @Param("bizType") Integer bizType,
                                                             @Param("cityId") Integer cityId,
                                                             @Param("distributeWay") Integer distributeWay);

    List<DistributeWeightPlat> listAll();


    List<DistributeWeightPlat> listNotEmptyEngineerLevelGroupListJson();

    List<DistributeWeightPlat> listByPlatIdAndBizType(@Param("ids") List<Integer> ids,
                                                      @Param("bizType") Integer bizType,
                                                      @Param("distributeWay") Integer distributeWay);

    List<DistributeWeightPlat> listCompanyByPlatIdAndType(@Param("ids") List<Integer> ids,
                                                      @Param("bizType") Integer bizType,
                                                      @Param("distributeWay") Integer distributeWay);

    List<Integer> hasBeenSetCity(CheckCityAvailableQuery query);

    Integer updateByKey(DistributeWeightPlat report);

    Integer updateStatusByQuery(DistributeWeightStatusQuery query);

    Integer updateBatchByKey(UpdateRepairOrderQuery updateRepairOrderQuery);

    /**
     * 编辑启用停用状态
     *
     * @param updateStatusQuery
     * @return
     */
    Integer updateStatus(UpdateStatusQuery updateStatusQuery);

    Integer updateEngineerLevelGroupListCurrentJsonByKey(DistributeWeightPlat distributeWeightPlat);

    Integer insert(DistributeWeightPlat distributeWeightPlat);

    Integer deleteByKey(@Param("distributePlatId") Integer distributePlatId);

    List<DistributeWeightPlat> findPlatDirectlyConfigByQuery(RobOrderQuery query);

}
